﻿@namespace LayuiBlazor.Components
@typeparam TModel
@inherits LayuiComponentBase

<CascadingValue Value="@EditorItems" IsFixed="true">
    @FieldItems?.Invoke(Model)
</CascadingValue>

@if (FirstRender)
{
    <div class="ef-loading">

    </div>
}
else
{
    <div class="layui-form">
        <CascadingValue Value="this" Name="EidtorForm">
            @foreach (var item in FormItems)
            {
                if (item.EditTemplate != null)
                {
                    @item.EditTemplate.Invoke(Model)
                }
                else
                {
                    <div class="@GetCssString(item)">
                        @AutoGenerateTemplate(item)
                    </div>
                }
            }
        </CascadingValue>
    </div>
}